package com.hnkywl.sts.entity.cggl;

import com.hnkywl.sts.entity.BaseEntity;
import com.hnkywl.sts.entity.cwgl.kmys.Cyfyys;
import com.hnkywl.sts.entity.organ.Qyjg;
import com.hnkywl.sts.entity.xsgl.Xsd;
import com.hnkywl.sts.entity.xsgl.Zkd;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.List;

/**
 * Created by Jerry on 13-10-17.
 */
@Entity
@Table(name = "T_BIZ_WLJSDMX")
@Where(clause = "deleted!='1'")
public class Wljsdmx extends BaseEntity {
    @Id
    @SequenceGenerator(name = "seqWljsdmx", allocationSize = 1, sequenceName = "SEQ_BIZ_WLJSDMX")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqWljsdmx")
    private Long id;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "CGD_ID")
    private Cgd cgd;
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "XSD_ID")
    private Xsd xsd;
    // 转库单
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ZKD_ID")
    private Zkd zkd;
    // 收益单位
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SYDW_ID")
    private Qyjg sydw;
    // 费用类别
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "CYFY_FYLB_ID")
    @NotFound(action = NotFoundAction.IGNORE)
    private Cyfyys fylb;
    // 计费数量
    private Double jfsl;
    // 单价
    private Double dj;
    // 金额
    private Double je;
    // 核定数量
    private Double hdsl;
    // 核定单价
    private Double hddj;
    // 核定金额
    private Double hdje;
    //可抵税额
    private Double kdse;
    //税额
    private Double se;
    //面额
    private Double me;
    //差额
    private Double ce;
    //净额
    private Double jsje;
    //费用类型 type=1销售 type=2采购
    private Integer type;
    // 备注
    private String bz;
    //物流结算单
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "WLJSD_ID")
    private Jsd jsd;
    //关联费用
    @ManyToOne
    @JoinColumn(name="GLFY_ID")
    private Glfy glfy;

    @OneToMany(fetch = FetchType.LAZY, targetEntity = Jsdfymx.class, mappedBy = "wljsdmx")
    @NotFound(action = NotFoundAction.IGNORE)
    private List<Jsdfymx> jsdfymxList;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Cgd getCgd() {
        return cgd;
    }

    public void setCgd(Cgd cgd) {
        this.cgd = cgd;
    }

    public Xsd getXsd() {
        return xsd;
    }

    public void setXsd(Xsd xsd) {
        this.xsd = xsd;
    }

    public Zkd getZkd() {
        return zkd;
    }

    public void setZkd(Zkd zkd) {
        this.zkd = zkd;
    }

    public Qyjg getSydw() {
        return sydw;
    }

    public void setSydw(Qyjg sydw) {
        this.sydw = sydw;
    }

    public Cyfyys getFylb() {
        return fylb;
    }

    public void setFylb(Cyfyys fylb) {
        this.fylb = fylb;
    }

    public Double getJfsl() {
        return jfsl;
    }

    public void setJfsl(Double jfsl) {
        this.jfsl = jfsl;
    }

    public Double getDj() {
        return dj;
    }

    public void setDj(Double dj) {
        this.dj = dj;
    }

    public Double getJe() {
        return je;
    }

    public void setJe(Double je) {
        this.je = je;
    }

    public Double getHdsl() {
        return hdsl;
    }

    public void setHdsl(Double hdsl) {
        this.hdsl = hdsl;
    }

    public Double getHddj() {
        return hddj;
    }

    public void setHddj(Double hddj) {
        this.hddj = hddj;
    }

    public Double getHdje() {
        return hdje;
    }

    public void setHdje(Double hdje) {
        this.hdje = hdje;
    }

    public Double getKdse() {
        return kdse;
    }

    public void setKdse(Double kdse) {
        this.kdse = kdse;
    }

    public Double getSe() {
        return se;
    }

    public void setSe(Double se) {
        this.se = se;
    }

    public Double getMe() {
        return me;
    }

    public void setMe(Double me) {
        this.me = me;
    }

    public Double getCe() {
        return ce;
    }

    public void setCe(Double ce) {
        this.ce = ce;
    }

    public Double getJsje() {
        return jsje;
    }

    public void setJsje(Double jsje) {
        this.jsje = jsje;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getBz() {
        return bz;
    }

    public void setBz(String bz) {
        this.bz = bz;
    }

    public Jsd getJsd() {
        return jsd;
    }

    public void setJsd(Jsd jsd) {
        this.jsd = jsd;
    }

    public Glfy getGlfy() {
        return glfy;
    }

    public void setGlfy(Glfy glfy) {
        this.glfy = glfy;
    }

    public List<Jsdfymx> getJsdfymxList() {
        return jsdfymxList;
    }

    public void setJsdfymxList(List<Jsdfymx> jsdfymxList) {
        this.jsdfymxList = jsdfymxList;
    }
}
